/* eslint-disable @typescript-eslint/no-unused-vars */
const ua = window.navigator.userAgent.toLowerCase();

// eslint-disable-next-line @typescript-eslint/naming-convention
export const ios = (() => /iphone|ipad|ipod/.test(ua))();

// eslint-disable-next-line @typescript-eslint/naming-convention
export const android = (() => /android/.test(ua))();

// eslint-disable-next-line @typescript-eslint/naming-convention
export const lowAndroid = (() => android && /android [5678]\./.test(ua))();

// eslint-disable-next-line @typescript-eslint/naming-convention
export const qqnews = (() => /qqnews/.test(ua))();

// eslint-disable-next-line @typescript-eslint/naming-convention
export const weixin = (() => /micromessenger/.test(ua))();

// eslint-disable-next-line @typescript-eslint/naming-convention
export const wxWork = (() => /wxwork/.test(ua))();

// eslint-disable-next-line @typescript-eslint/naming-convention
export const tvideo = (() => /qqlivebrowser/.test(ua))();

// eslint-disable-next-line @typescript-eslint/naming-convention
export const qq = (() => /qq\//.test(ua))();

// eslint-disable-next-line @typescript-eslint/naming-convention
export const mobile = () => /android|webos|iphone|ipad|ipod|blackberry|iemobile|opera mini/i.test(ua);

// eslint-disable-next-line @typescript-eslint/naming-convention
export const pc = (() => {
  const res = /android|webos|iphone|ipad|ipod|blackberry|iemobile|opera mini/i.test(ua);
  return !res;
})();
